﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcMusicStore.Models.Album>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div style="padding: 0px 10px 10px 10px;">
        <p>
            <%: Ajax.jQueryActionLink("Create New", "ui-icon ui-icon-document-b","Create") %>
        </p>
        <table class="ui-widget" cellpadding="3" cellspacing="0" width="100%">
            <tr>
                <th class="ui-widget-header ui-state-active">
                </th>
                <th class="ui-widget-header ui-state-active">
                    Title
                </th>
                <th class="ui-widget-header ui-state-active">
                    Artist
                </th>
                <th class="ui-widget-header ui-state-active">
                    Genre
                </th>
            </tr>
            <% foreach (var item in Model)
               { %>
            <tr>
                <td style="border-bottom: 1px solid #cccccc;">
                    <%: Html.ActionLink("Edit", "Edit", new { id=item.AlbumId }) %>
                    |
                    <%: Html.ActionLink("Delete", "Delete", new { id=item.AlbumId })%>
                </td>
                <td style="border-bottom: 1px solid #cccccc;">
                    <%: Html.Truncate(item.Title, 25) %>
                </td>
                <td style="border-bottom: 1px solid #cccccc;">
                    <%: Html.Truncate(item.Artist.Name, 25) %>
                </td>
                <td style="border-bottom: 1px solid #cccccc;">
                    <%: item.Genre.Name %>
                </td>
            </tr>
            <% } %>
        </table>
    </div>
</asp:Content>
